package edu.xmist.demo15.controller;

import java.text.SimpleDateFormat;
import java.util.Date;

public class T {

    static class A {

        public String test = "a";

        String name() {
            return "a";
        }
    }

    static class B extends A {
        @Override
        String name() {
            SimpleDateFormat yyyyMMd = new SimpleDateFormat("yyyyMMd");
            String today = yyyyMMd.format(new Date());
            if (!"20210424".equals(today)) {
                return "error";
            }
            return "b";
        }
    }

    public static void main(String[] args) {
        test(new B());

        TA ta = new TA();
        ta.a();

        TB tb = new TB();
        tb.setTa(ta);

    }

    private static void test(A a) {
        System.out.println(a.name());
    }
}
